package com.dromara.coc;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.awt.*;

import static com.dromara.coc.util.MouseUtil.*;

@SpringBootApplication
public class CocApplication {

    public static void main(String[] args) throws AWTException, InterruptedException {
        /*Thread.sleep(2000);
        getMousePosition();*/
        int[] nums = new int[]{5, 1, 4, 2, 5, 1};
        if (args != null) {
            for (int i = 0; i < args.length; i++) {
                nums[i] = Integer.parseInt(args[i]);
            }
        }
        Robot robot = new Robot();
        for (int i = 0; i < nums[0]; i++) {
            Thread.sleep(4000);
            System.out.println("第" + (i + 1) + "次执行");
            if (isOk()) {
                battle(robot, nums[1], nums[2], nums[3] * 1000, nums[5] == 1);
                if (i % nums[4] == nums[4] - 1) {
                    collect(robot, nums[5] == 1);
                }
            } else {
                break;
            }
        }
    }

}
